Rule

Rules for foreign keys when updating or deleting.

Values

ValueMeaning
noAction

When a parent key is modified or deleted from the collection, no special action is taken. If you are using MySQL or MSSQL use $(SRCTAG Rule.restrict) instead for the desired effect.

restrict

The item is prohibited from deleting or modifying a parent key when there exists one or more child keys mapped to it. This is the default.

$(THROWS ForeignKeyException, when a member changes.)

setNull

Sets the member to null when deleting or modifying a parent key.

$(THROWS ForeignKeyException, when the type cannot be set to null.)

setDefault

Sets the member to the Default value when deleting or modifying a parent key. If there is no defined Default then the member is set to its types initial value.

cascade

Updates or deletes the item based on what happened to the parent key.

Meta